import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;

/**
 * Created by baichuan on 2016/12/16.
 */
public class AntTest {
    private String filePath = "ant.txt";
    private FileOutputStream fout;

    private void write() {

        try {
            fout = new FileOutputStream(new File(filePath));
            String str = "asdfasdfasdfasdfasdf";
            fout.write(str.getBytes());
            fout.flush();
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            try {
                if (fout != null)
                    fout.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }

    public static void main(String[] args) {
        AntTest antTest = new AntTest();
    }
}
